﻿#ifndef ZOOMVIDEOWIDGET_H
#define ZOOMVIDEOWIDGET_H

#include <QWidget>

class QToolBar;
class VideoWindow;

class ZoomVideoWidget : public QWidget
{
    Q_OBJECT
public:
    explicit ZoomVideoWidget(VideoWindow *parent);
    void setTitle();
    void setRotate(quint8 rotateValue);
    quint8 getRotate();
protected:
    void paintEvent(QPaintEvent * e);
    void resizeEvent(QResizeEvent *e);
    void enterEvent(QEvent *e);
    void leaveEvent(QEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void mouseDoubleClickEvent(QMouseEvent *e);
    void keyPressEvent(QKeyEvent *e);
private slots:
    void zoomTo();
    void separate();
    void clockwiseRotate();
    void anticlockwiseRotate();
    void resetRotate();
private:
    void adJustVideoRect(const QSize &totalSize);
    inline QSize videoSize();
    qreal exactlyFactor();
    VideoWindow *sourceWidget;
    QToolBar *toolBar;
    QRect videoRect;
    quint8 rotate;
};

#endif // ZOOMVIDEOWIDGET_H
